define(['vue','common'],function (Vue,common){
    const {createApp} = Vue
    const Controller = {
        index:function (){
            const app = createApp({
                data(){
                    return {
                        options:{
                            pk:"id",
                            sort:'id',
                            order:"desc",
                            loading:true,
                            toolbar:{
                                del:true,
                                refresh:true,
                                add:true,
                                export:true,
                                import:true,
                                buttons:[
                                    {
                                        title:"测试11",
                                        type:"",
                                        isAjax:false,
                                        url:"/app/muadmin/admin/test/testopen",
                                        // area:'["80%","80%"]',
                                        refresh:true,
                                        // confirm:"确定要删除这些数据吗?",
                                        visible:function (row){
                                            return row.status == 1;
                                        }
                                    }
                                ]
                                // importTemplate:true,
                                // importTemplateUrl:Config.sub_url+"/admin/importTemplate",
                                // importUrl:Config.sub_url+"/admin/import",
                                // exportUrl:Config.sub_url+"/admin/export",
                                // exportTemplateUrl:Config.sub_url+"/admin/exportTemplate",
                            },
                            // isTree:true,
                            columns:[
                                {
                                    type:"selection",
                                },
                                {
                                    title:"ID",
                                    field:"id",
                                    type:"text",
                                    sortable:true,
                                    width:100,
                                    align:"center",
                                    operate:'between',
                                    visible:true,
                                },
                                {
                                    title:"名称",
                                    field:"name",
                                },
                                {
                                    title:"图片",
                                    field:"url",
                                    type:"img",
                                    operate:false
                                },
                                {
                                    title:"多图片",
                                    field:"urls",
                                    type:"imgs",
                                    operate:false
                                },
                                {
                                    title:"测试多",
                                    field:"mytest",
                                    type:"normal",
                                    searchList:{
                                        1:"测试",
                                        2:"请输入名称"
                                    }
                                },
                                {
                                    title:"状态",
                                    field:"status",
                                    type:"switch",
                                    sortable:true,
                                    searchList:{
                                        0:"禁用",
                                        1:"启用"
                                    }
                                },
                                {
                                    title:"创建时间",
                                    field:"createtime",
                                    type:"datetime",
                                    sortable:true
                                },
                                {
                                    title:"操作",
                                    type:"operate",
                                    button:['edit','del'],
                                    buttons:[
                                        {
                                            title:"测试",
                                            type:"",
                                            isAjax:false,
                                            url:"/app/muadmin/admin/test/testopen",
                                            // area:'["100%","80%"]',
                                            // confirm:"确定要删除这些数据吗?",
                                            visible:function (row){
                                                return row.status == 1;
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                }
            })
            common.load( app,['all'])
            app.mount('#app')
        },
        edit:function (){
            const app = createApp({
                data(){
                    return {
                        options:{
                            button:['cancel','confirm'],
                            labelWidth:'100px',
                            form:[
                                {
                                    type:'text',
                                    label:'用户名',
                                    name:'name',
                                    placeholder:'请输入用户名',
                                    required:true,
                                    value:'测试姓名',
                                    rules:[
                                        { required: true, message: '请输入用户名', trigger: 'blur' }
                                    ]
                                },
                                {
                                    type:'textarea',
                                    label:'多行文本',
                                    name:'duohangwenben',
                                    required:true
                                },

                                {
                                    type:'color',
                                    label:'颜色编辑器',
                                    name:'yanse',
                                    required:true
                                },
                                {
                                    type:'imgs',
                                    label:'图片',
                                    name:'url',
                                    required:true
                                },
                                // {
                                //     type:'file',
                                //     label:'多图片',
                                //     name:'urls',
                                //     required:true
                                // },
                                {
                                    type:'select',
                                    label:'测试多',
                                    name:'mytest',
                                    required:true,
                                    options:{
                                        1:"测试",
                                        2:"请输入名称"
                                    }
                                },
                                {
                                    type:'date',
                                    label:'日期',
                                    name:'riqi',
                                    required:true,
                                },
                                {
                                    type:'daterange',
                                    label:'日期范围',
                                    name:'riqifanwei',
                                },
                                {
                                    type:'datetime',
                                    label:'日期时间',
                                    name:'riqishijian',
                                },
                                {
                                    type:'datetimerange',
                                    label:'日期时间区间',
                                    name:'riqishijianqujian',
                                },
                                {
                                    type:'time',
                                    label:'时间',
                                    name:'shijian',
                                },
                                {
                                    type:'timerange',
                                    label:'时间区间',
                                    name:'shijianqujian',
                                },
                                {
                                    type:'range',
                                    label:'区间',
                                    name:'qujian',
                                },
                                {
                                    type:'switch',
                                    label:'测试多',
                                    name:'status',
                                    required:true,
                                    options:{
                                        0:"禁用",
                                        1:"启用"
                                    },
                                    value:1
                                },
                                {
                                    type:'radio',
                                    label:'单选框',
                                    name:'danxuan',
                                    required:true,
                                    labelField:'name',
                                    valueField:'id',
                                    options:[
                                        {
                                            id:1,
                                            name:'选项1'
                                        },
                                        {
                                            id:2,
                                            name:'选项2'
                                        }
                                    ],
                                    value:''
                                },
                                {
                                    type:'checkbox',
                                    label:'单选框',
                                    name:'duoxuankuang',
                                    required:true,
                                    labelField:'name',
                                    valueField:'id',
                                    options:[
                                        {
                                            id:1,
                                            name:'选项1'
                                        },
                                        {
                                            id:2,
                                            name:'选项2'
                                        }
                                    ],
                                    value:[]
                                },
                                {
                                    type:'array',
                                    label:'数组',
                                    name:'shuzu',
                                    value:[]
                                },
                                {
                                    type:'cascader',
                                    label:'新测试',
                                    name:'cascader',
                                    required:true,
                                    multiple:true,
                                    labelField:'label',
                                    valueField:'value',
                                    options:[
                                        {
                                            value: 'guide',
                                            label: 'Guide',
                                            children: [
                                                {
                                                    value: 'disciplines',
                                                    label: 'Disciplines',
                                                    children: [
                                                        {
                                                            value: 'consistency',
                                                            label: 'Consistency',
                                                        },
                                                        {
                                                            value: 'feedback',
                                                            label: 'Feedback',
                                                        },
                                                        {
                                                            value: 'efficiency',
                                                            label: 'Efficiency',
                                                        },
                                                        {
                                                            value: 'controllability',
                                                            label: 'Controllability',
                                                        },
                                                    ],
                                                },
                                                {
                                                    value: 'navigation',
                                                    label: 'Navigation',
                                                    children: [
                                                        {
                                                            value: 'side nav',
                                                            label: 'Side Navigation',
                                                        },
                                                        {
                                                            value: 'top nav',
                                                            label: 'Top Navigation',
                                                        },
                                                    ],
                                                },
                                            ],
                                        },
                                        {
                                            value: 'component',
                                            label: 'Component',
                                            children: [
                                                {
                                                    value: 'basic',
                                                    label: 'Basic',
                                                    children: [
                                                        {
                                                            value: 'layout',
                                                            label: 'Layout',
                                                        },
                                                        {
                                                            value: 'color',
                                                            label: 'Color',
                                                        },
                                                        {
                                                            value: 'typography',
                                                            label: 'Typography',
                                                        },
                                                        {
                                                            value: 'icon',
                                                            label: 'Icon',
                                                        },
                                                        {
                                                            value: 'button',
                                                            label: 'Button',
                                                        },
                                                    ],
                                                },
                                                {
                                                    value: 'form',
                                                    label: 'Form',
                                                    children: [
                                                        {
                                                            value: 'radio',
                                                            label: 'Radio',
                                                        },
                                                        {
                                                            value: 'checkbox',
                                                            label: 'Checkbox',
                                                        },
                                                        {
                                                            value: 'input',
                                                            label: 'Input',
                                                        },
                                                        {
                                                            value: 'input-number',
                                                            label: 'InputNumber',
                                                        },
                                                        {
                                                            value: 'select',
                                                            label: 'Select',
                                                        },
                                                        {
                                                            value: 'cascader',
                                                            label: 'Cascader',
                                                        },
                                                        {
                                                            value: 'switch',
                                                            label: 'Switch',
                                                        },
                                                        {
                                                            value: 'slider',
                                                            label: 'Slider',
                                                        },
                                                        {
                                                            value: 'time-picker',
                                                            label: 'TimePicker',
                                                        },
                                                        {
                                                            value: 'date-picker',
                                                            label: 'DatePicker',
                                                        },
                                                        {
                                                            value: 'datetime-picker',
                                                            label: 'DateTimePicker',
                                                        },
                                                        {
                                                            value: 'upload',
                                                            label: 'Upload',
                                                        },
                                                        {
                                                            value: 'rate',
                                                            label: 'Rate',
                                                        },
                                                        {
                                                            value: 'form',
                                                            label: 'Form',
                                                        },
                                                    ],
                                                },
                                                {
                                                    value: 'data',
                                                    label: 'Data',
                                                    children: [
                                                        {
                                                            value: 'table',
                                                            label: 'Table',
                                                        },
                                                        {
                                                            value: 'tag',
                                                            label: 'Tag',
                                                        },
                                                        {
                                                            value: 'progress',
                                                            label: 'Progress',
                                                        },
                                                        {
                                                            value: 'tree',
                                                            label: 'Tree',
                                                        },
                                                        {
                                                            value: 'pagination',
                                                            label: 'Pagination',
                                                        },
                                                        {
                                                            value: 'badge',
                                                            label: 'Badge',
                                                        },
                                                    ],
                                                },
                                                {
                                                    value: 'notice',
                                                    label: 'Notice',
                                                    children: [
                                                        {
                                                            value: 'alert',
                                                            label: 'Alert',
                                                        },
                                                        {
                                                            value: 'loading',
                                                            label: 'Loading',
                                                        },
                                                        {
                                                            value: 'message',
                                                            label: 'Message',
                                                        },
                                                        {
                                                            value: 'message-box',
                                                            label: 'MessageBox',
                                                        },
                                                        {
                                                            value: 'notification',
                                                            label: 'Notification',
                                                        },
                                                    ],
                                                },
                                                {
                                                    value: 'navigation',
                                                    label: 'Navigation',
                                                    children: [
                                                        {
                                                            value: 'menu',
                                                            label: 'Menu',
                                                        },
                                                        {
                                                            value: 'tabs',
                                                            label: 'Tabs',
                                                        },
                                                        {
                                                            value: 'breadcrumb',
                                                            label: 'Breadcrumb',
                                                        },
                                                        {
                                                            value: 'dropdown',
                                                            label: 'Dropdown',
                                                        },
                                                        {
                                                            value: 'steps',
                                                            label: 'Steps',
                                                        },
                                                    ],
                                                },
                                                {
                                                    value: 'others',
                                                    label: 'Others',
                                                    children: [
                                                        {
                                                            value: 'dialog',
                                                            label: 'Dialog',
                                                        },
                                                        {
                                                            value: 'tooltip',
                                                            label: 'Tooltip',
                                                        },
                                                        {
                                                            value: 'popover',
                                                            label: 'Popover',
                                                        },
                                                        {
                                                            value: 'card',
                                                            label: 'Card',
                                                        },
                                                        {
                                                            value: 'carousel',
                                                            label: 'Carousel',
                                                        },
                                                        {
                                                            value: 'collapse',
                                                            label: 'Collapse',
                                                        },
                                                    ],
                                                },
                                            ],
                                        },
                                        {
                                            value: 'resource',
                                            label: 'Resource',
                                            children: [
                                                {
                                                    value: 'axure',
                                                    label: 'Axure Components',
                                                },
                                                {
                                                    value: 'sketch',
                                                    label: 'Sketch Templates',
                                                },
                                                {
                                                    value: 'docs',
                                                    label: 'Design Documentation',
                                                },
                                            ],
                                        },
                                    ],
                                    value:1
                                },
                                {
                                    type:'editor',
                                    label:'富文本编辑器',
                                    name:'fuwenben',
                                    required:true,
                                    value:"<p>阿萨法大法师</p>"
                                },
                                {
                                    type:'datetime',
                                    label:'创建时间',
                                    name:'cretetime',
                                    required:true,
                                },

                            ],

                        }

                    }
                }
            })
            common.load(app,'all')
            app.mount('#app')
        },
        add:function (){
          const app = createApp({
              data(){
                  return {
                      options:{
                          button:['cancel','confirm'],
                          labelWidth:'100px',
                          form:[
                              {
                              type:'text',
                              label:'用户名',
                              name:'name',
                              placeholder:'请输入用户名',
                              required:true,
                              value:'测试姓名',
                              rules:[
                                      { required: true, message: '请输入用户名', trigger: 'blur' }
                              ]
                            },
                              {
                                  type:'textarea',
                                  label:'多行文本',
                                  name:'duohangwenben',
                                  required:true
                              },

                              {
                                  type:'color',
                                  label:'颜色编辑器',
                                  name:'yanse',
                                  required:true
                              },
                              {
                                  type:'imgs',
                                  label:'图片',
                                  name:'url',
                                  required:true
                              },
                              // {
                              //     type:'file',
                              //     label:'多图片',
                              //     name:'urls',
                              //     required:true
                              // },
                              {
                                  type:'select',
                                  label:'测试多',
                                  name:'mytest',
                                  required:true,
                                  options:{
                                      1:"测试",
                                      2:"请输入名称"
                                  }
                              },
                              {
                                  type:'date',
                                  label:'日期',
                                  name:'riqi',
                                  required:true,
                              },
                              {
                                  type:'daterange',
                                  label:'日期范围',
                                  name:'riqifanwei',
                              },
                              {
                                  type:'datetime',
                                  label:'日期时间',
                                  name:'riqishijian',
                              },
                              {
                                  type:'datetimerange',
                                  label:'日期时间区间',
                                  name:'riqishijianqujian',
                              },
                              {
                                  type:'time',
                                  label:'时间',
                                  name:'shijian',
                              },
                              {
                                  type:'timerange',
                                  label:'时间区间',
                                  name:'shijianqujian',
                              },
                              {
                                  type:'range',
                                  label:'区间',
                                  name:'qujian',
                              },
                              {
                                  type:'switch',
                                  label:'测试多',
                                  name:'status',
                                  required:true,
                                  options:{
                                      0:"禁用",
                                      1:"启用"
                                  },
                                  value:1
                              },
                              {
                                  type:'radio',
                                  label:'单选框',
                                  name:'danxuan',
                                  required:true,
                                  labelField:'name',
                                  valueField:'id',
                                  options:[
                                      {
                                          id:1,
                                          name:'选项1'
                                      },
                                      {
                                          id:2,
                                          name:'选项2'
                                      }
                                  ],
                                  value:''
                              },
                              {
                                  type:'checkbox',
                                  label:'单选框',
                                  name:'duoxuankuang',
                                  required:true,
                                  labelField:'name',
                                  valueField:'id',
                                  options:[
                                      {
                                          id:1,
                                          name:'选项1'
                                      },
                                      {
                                          id:2,
                                          name:'选项2'
                                      }
                                  ],
                                  value:[]
                              },
                              {
                                  type:'array',
                                  label:'数组',
                                  name:'shuzu',
                                  value:[]
                              },
                              {
                                  type:'cascader',
                                  label:'新测试',
                                  name:'cascader',
                                  required:true,
                                  multiple:true,
                                  labelField:'label',
                                  valueField:'value',
                                  options:[
                                      {
                                          value: 'guide',
                                          label: 'Guide',
                                          children: [
                                              {
                                                  value: 'disciplines',
                                                  label: 'Disciplines',
                                                  children: [
                                                      {
                                                          value: 'consistency',
                                                          label: 'Consistency',
                                                      },
                                                      {
                                                          value: 'feedback',
                                                          label: 'Feedback',
                                                      },
                                                      {
                                                          value: 'efficiency',
                                                          label: 'Efficiency',
                                                      },
                                                      {
                                                          value: 'controllability',
                                                          label: 'Controllability',
                                                      },
                                                  ],
                                              },
                                              {
                                                  value: 'navigation',
                                                  label: 'Navigation',
                                                  children: [
                                                      {
                                                          value: 'side nav',
                                                          label: 'Side Navigation',
                                                      },
                                                      {
                                                          value: 'top nav',
                                                          label: 'Top Navigation',
                                                      },
                                                  ],
                                              },
                                          ],
                                      },
                                      {
                                          value: 'component',
                                          label: 'Component',
                                          children: [
                                              {
                                                  value: 'basic',
                                                  label: 'Basic',
                                                  children: [
                                                      {
                                                          value: 'layout',
                                                          label: 'Layout',
                                                      },
                                                      {
                                                          value: 'color',
                                                          label: 'Color',
                                                      },
                                                      {
                                                          value: 'typography',
                                                          label: 'Typography',
                                                      },
                                                      {
                                                          value: 'icon',
                                                          label: 'Icon',
                                                      },
                                                      {
                                                          value: 'button',
                                                          label: 'Button',
                                                      },
                                                  ],
                                              },
                                              {
                                                  value: 'form',
                                                  label: 'Form',
                                                  children: [
                                                      {
                                                          value: 'radio',
                                                          label: 'Radio',
                                                      },
                                                      {
                                                          value: 'checkbox',
                                                          label: 'Checkbox',
                                                      },
                                                      {
                                                          value: 'input',
                                                          label: 'Input',
                                                      },
                                                      {
                                                          value: 'input-number',
                                                          label: 'InputNumber',
                                                      },
                                                      {
                                                          value: 'select',
                                                          label: 'Select',
                                                      },
                                                      {
                                                          value: 'cascader',
                                                          label: 'Cascader',
                                                      },
                                                      {
                                                          value: 'switch',
                                                          label: 'Switch',
                                                      },
                                                      {
                                                          value: 'slider',
                                                          label: 'Slider',
                                                      },
                                                      {
                                                          value: 'time-picker',
                                                          label: 'TimePicker',
                                                      },
                                                      {
                                                          value: 'date-picker',
                                                          label: 'DatePicker',
                                                      },
                                                      {
                                                          value: 'datetime-picker',
                                                          label: 'DateTimePicker',
                                                      },
                                                      {
                                                          value: 'upload',
                                                          label: 'Upload',
                                                      },
                                                      {
                                                          value: 'rate',
                                                          label: 'Rate',
                                                      },
                                                      {
                                                          value: 'form',
                                                          label: 'Form',
                                                      },
                                                  ],
                                              },
                                              {
                                                  value: 'data',
                                                  label: 'Data',
                                                  children: [
                                                      {
                                                          value: 'table',
                                                          label: 'Table',
                                                      },
                                                      {
                                                          value: 'tag',
                                                          label: 'Tag',
                                                      },
                                                      {
                                                          value: 'progress',
                                                          label: 'Progress',
                                                      },
                                                      {
                                                          value: 'tree',
                                                          label: 'Tree',
                                                      },
                                                      {
                                                          value: 'pagination',
                                                          label: 'Pagination',
                                                      },
                                                      {
                                                          value: 'badge',
                                                          label: 'Badge',
                                                      },
                                                  ],
                                              },
                                              {
                                                  value: 'notice',
                                                  label: 'Notice',
                                                  children: [
                                                      {
                                                          value: 'alert',
                                                          label: 'Alert',
                                                      },
                                                      {
                                                          value: 'loading',
                                                          label: 'Loading',
                                                      },
                                                      {
                                                          value: 'message',
                                                          label: 'Message',
                                                      },
                                                      {
                                                          value: 'message-box',
                                                          label: 'MessageBox',
                                                      },
                                                      {
                                                          value: 'notification',
                                                          label: 'Notification',
                                                      },
                                                  ],
                                              },
                                              {
                                                  value: 'navigation',
                                                  label: 'Navigation',
                                                  children: [
                                                      {
                                                          value: 'menu',
                                                          label: 'Menu',
                                                      },
                                                      {
                                                          value: 'tabs',
                                                          label: 'Tabs',
                                                      },
                                                      {
                                                          value: 'breadcrumb',
                                                          label: 'Breadcrumb',
                                                      },
                                                      {
                                                          value: 'dropdown',
                                                          label: 'Dropdown',
                                                      },
                                                      {
                                                          value: 'steps',
                                                          label: 'Steps',
                                                      },
                                                  ],
                                              },
                                              {
                                                  value: 'others',
                                                  label: 'Others',
                                                  children: [
                                                      {
                                                          value: 'dialog',
                                                          label: 'Dialog',
                                                      },
                                                      {
                                                          value: 'tooltip',
                                                          label: 'Tooltip',
                                                      },
                                                      {
                                                          value: 'popover',
                                                          label: 'Popover',
                                                      },
                                                      {
                                                          value: 'card',
                                                          label: 'Card',
                                                      },
                                                      {
                                                          value: 'carousel',
                                                          label: 'Carousel',
                                                      },
                                                      {
                                                          value: 'collapse',
                                                          label: 'Collapse',
                                                      },
                                                  ],
                                              },
                                          ],
                                      },
                                      {
                                          value: 'resource',
                                          label: 'Resource',
                                          children: [
                                              {
                                                  value: 'axure',
                                                  label: 'Axure Components',
                                              },
                                              {
                                                  value: 'sketch',
                                                  label: 'Sketch Templates',
                                              },
                                              {
                                                  value: 'docs',
                                                  label: 'Design Documentation',
                                              },
                                          ],
                                      },
                                  ],
                                  value:1
                              },
                              {
                                  type:'editor',
                                  label:'富文本编辑器',
                                  name:'fuwenben',
                                  required:true,
                                  value:"<p>阿萨法大法师</p>"
                              },
                              {
                                  type:'datetime',
                                  label:'创建时间',
                                  name:'cretetime',
                                  required:true,
                              },

                          ],

                      }
                  }
              }
          })
            common.load(app,['all'])
            app.mount('#app')
        },
        testopen:function (){
            const app = createApp({
                data(){
                    return {
                        name:"test"
                    }
                }
            })
            common.load(app,'all')
            app.mount('#app')
        }
    }
    return Controller;
})